home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / fractal / kaos.lha / complib / mprod.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-11-18  |  330 b   |  22 lines

  1. /*
  2. ### product or two integer matrices ###
  3. */
  4.  
  5. mprod(q,a,b,narow,nacol,nbcol)
  6. double *q, *a, *b;
  7. int narow,nacol,nbcol;
  8. {
  9. int i,j,m,kij,kim,kmj;
  10. for(i=0;i<narow;i++){
  11.     for(j=0;j<nbcol;j++){
  12.         kij=i*nbcol+j;
  13.         *(q+kij) = 0;
  14.         for(m=0;m<nacol;m++){
  15.             kim=i*nacol+m;
  16.             kmj=m*nbcol+j;
  17.             *(q+kij) += *(a+kim) * *(b+kmj);
  18.         }
  19.     }
  20. }
  21. }
  22.